const getters = {
  authorId: state => state.user.authorId,
  userinfo: state => state.user.info,
  userid: state => state.user.info.id,
  avatar: state => state.user.info.avatar,
  username: state => state.user.info.realname,
  introduction: state => state.user.info.introduction,
  roles: state => state.user.info.roles,
  roleNames: state => {
    let roles = (state.user.info.roles || [])
    return roles.map(e => e.name || e)
  },
  sidebar: state => state.app.sidebar,
  size: state => state.app.size,
  device: state => state.app.device,
  tagsRecommand: state => state.stateFlags.tagsRecommand,
  visitedViews: state => state.tagsView.visitedViews,
  cachedViews: state => state.tagsView.cachedViews,
  permission_routes: state => state.permission.routes,
  routes: state => state.permission.routes,
  sub_pages: state => state.permission.subPages,
  errorLogs: state => state.errorLog.logs,
  
  text_color: state => state.editor.text_color,
  highlight_color: state => state.editor.highlight_color,
}

export default getters
